
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Test &#8212; PixieDust Documentation</title>
    <link rel="stylesheet" href="_static/better.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="_static/custom.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '1.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="shortcut icon" href="_static/pd_icon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="PixieApps" href="pixieapps.html" />
    <link rel="prev" title="Build a Renderer" href="renderer.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  </head>
  <body>
    <header id="pageheader"><h1><a href="index.html ">
        PixieDust Documentation
    </a></h1></header>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="test">
<h1>Test<a class="headerlink" href="#test" title="Permalink to this headline">¶</a></h1>
<p>PixieDust provides several <a class="reference external" href="https://github.com/ibm-cds-labs/pixiedust/tree/master/tests">notebooks</a> that you can run to test and check stability of various features. Tests are maintained using <a class="reference external" href="https://travis-ci.org/ibm-cds-labs/pixiedust">Travis CI</a>.</p>
<p>The test script, <a class="reference external" href="https://github.com/ibm-cds-labs/pixiedust/blob/master/tests/runPixiedustNotebooks.py">runPixiedustNotebooks.py</a>, runs whenever an update is pushed to the repository or a pull request is made. The test script runs through each of the notebooks in the <a class="reference external" href="https://github.com/ibm-cds-labs/pixiedust/tree/master/tests">tests</a> directory.</p>
<div class="section" id="locally-running-the-tests">
<h2>Locally Running the Tests<a class="headerlink" href="#locally-running-the-tests" title="Permalink to this headline">¶</a></h2>
<div class="section" id="using-vscode">
<h3>Using VSCode<a class="headerlink" href="#using-vscode" title="Permalink to this headline">¶</a></h3>
<ol class="arabic simple">
<li>Install the <a class="reference external" href="http://donjayamanne.github.io/pythonVSCode/">python extension</a> into VSCode</li>
<li>Open the pixiedust repository/directory in VSCode</li>
<li>Set the <strong>python.pythonPath</strong> in the <em>User Settings</em> of the VSCode Preferences to the appropriate location of your python directory</li>
<li>From the Debug View, click on the Configure gear and select Python</li>
<li>Edit the <code class="docutils literal"><span class="pre">launch.json</span></code> and add a new object (or edit an existing one) in <em>configurations</em></li>
</ol>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;pixiedust test&quot;</span><span class="p">,</span>
  <span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;python&quot;</span><span class="p">,</span>
  <span class="s2">&quot;request&quot;</span><span class="p">:</span> <span class="s2">&quot;launch&quot;</span><span class="p">,</span>
  <span class="s2">&quot;stopOnEntry&quot;</span><span class="p">:</span> <span class="n">false</span><span class="p">,</span>
  <span class="s2">&quot;pythonPath&quot;</span><span class="p">:</span> <span class="s2">&quot;$</span><span class="si">{config.python.pythonPath}</span><span class="s2">&quot;</span><span class="p">,</span>
  <span class="s2">&quot;program&quot;</span><span class="p">:</span> <span class="s2">&quot;$</span><span class="si">{workspaceRoot}</span><span class="s2">/tests/runPixiedustNotebooks.py&quot;</span><span class="p">,</span>
  <span class="s2">&quot;console&quot;</span><span class="p">:</span> <span class="s2">&quot;integratedTerminal&quot;</span><span class="p">,</span>
  <span class="s2">&quot;debugOptions&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="s2">&quot;WaitOnAbnormalExit&quot;</span><span class="p">,</span>
    <span class="s2">&quot;WaitOnNormalExit&quot;</span>
  <span class="p">],</span>
  <span class="s2">&quot;env&quot;</span><span class="p">:</span> <span class="p">{</span>
    <span class="s2">&quot;SPARK_HOME&quot;</span><span class="p">:</span> <span class="s2">&quot;/Users/path/to/spark&quot;</span><span class="p">,</span>
    <span class="s2">&quot;SCALA_HOME&quot;</span><span class="p">:</span> <span class="s2">&quot;/Users/path/to/scala&quot;</span><span class="p">,</span>
    <span class="s2">&quot;PIXIEDUST_TEST_INPUT&quot;</span><span class="p">:</span> <span class="s2">&quot;$</span><span class="si">{workspaceRoot}</span><span class="s2">/tests&quot;</span>
  <span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Update the <code class="docutils literal"><span class="pre">SPARK_HOME</span></code> and <code class="docutils literal"><span class="pre">SCALA_HOME</span></code> entries accordingly. If you want, update <code class="docutils literal"><span class="pre">PIXIEDUST_TEST_INPUT</span></code> to where test notebooks to run are located</p>
<ol class="arabic simple" start="6">
<li>Select the newly created or updated <strong>pixiedust test</strong> configuration from dropdown in the Debug view</li>
<li>Click on the Debug green arrow, to run the configuration</li>
</ol>
<p>The Integrated Terminal should show the test output as the tests are running.</p>
</div>
<div class="section" id="using-command-line">
<h3>Using Command Line<a class="headerlink" href="#using-command-line" title="Permalink to this headline">¶</a></h3>
<p>From a terminal window:</p>
<ol class="arabic simple">
<li>Go into the <code class="docutils literal"><span class="pre">tests</span></code> directory in the pixiedust repository/directory</li>
<li>Set the following environment variables accordingly</li>
</ol>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">SPARK_HOME</span><span class="o">=/</span><span class="n">Users</span><span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">spark</span>
<span class="n">SCALA_HOME</span><span class="o">=/</span><span class="n">Users</span><span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">scala</span>
<span class="n">PIXIEDUST_TEST_INPUT</span><span class="o">=/</span><span class="n">Users</span><span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">test</span><span class="o">/</span><span class="n">notebooks</span>
</pre></div>
</div>
<ol class="arabic simple" start="3">
<li>Run the command <code class="docutils literal"><span class="pre">python</span> <span class="pre">runPixiedustNotebooks.py</span></code></li>
</ol>
<p>The terminal window should show the test output as the tests are running.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="use.html">Use PixieDust</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="develop.html">Develop for PixieDust</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="contribute.html">Contribute</a></li>
<li class="toctree-l2"><a class="reference internal" href="writeviz.html">Write a new PixieDust Visualization</a></li>
<li class="toctree-l2"><a class="reference internal" href="renderer.html">Build a Renderer</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Test</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="pixieapps.html">PixieApps</a></li>
<li class="toctree-l1"><a class="reference internal" href="pixiegateway.html">PixieGateway</a></li>
<li class="toctree-l1"><a class="reference internal" href="releasenotes.html">Release Notes</a></li>
</ul>

<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
  <footer id="pagefooter">&copy; 2017, IBM.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a>
      1.6.3.

  </footer>

  
  </body>
</html>